/*
 *  Copyright 2020-2021 Li Fei
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.pengshun.modules.api.coal.result;

import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.Id;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Random;

/**
 * @author lifei
 * @description /
 * @date 2020-11-04
 **/
@Data
@Entity
public class MerchantResult implements Serializable {

    /**
     * id
     */
    @Id
    private BigInteger id;

    private BigDecimal score;

    /**
     * 图片
     */
    private String doorImg;

    /**
     * 商户名称
     */
    private String name;

    /**
     * 状态
     */
    private Integer status;

    /**
     * 详细地址
     */
    private String detailAddress;

    /**
     * 煤炭数量
     */
    private BigInteger coalNum;
    private BigInteger carNum;

    /**
     * 运输部数量
     */
    private BigInteger transportNum;

    private Long lookNum;



    private Long distance;

    private Integer level;

    private String distances;

    public String getDistances() {
        if (distance != null) {
            distances = Math.round(distance/100/10)+"km";
        }
        return distances;
    }

    public MerchantResult() {
    }
}